import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import cai from '../views/cai.vue'
import yong from '../views/yong.vue'
import quan from '../views/quan.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/cai',
    name: 'cai',
    component: cai,
    children: [
      {
        path: '/',
        name: 'yong',
        component: yong,
      },
      {
        path: '/yong',
        name: 'yong',
        component: yong,
      },
      {
        path: '/quan',
        name: 'quan',
        component: quan,
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
